#include <iostream>
#include <unistd.h>
#include <cstring>
#include "ShareMemory.hpp"
#include "Time.hpp"

int main()
{
    gShareMemory.GetShm();
    gShareMemory.AttachShm();

    struct data *image = (struct data*)gShareMemory.GetAddr();

    char ch = 'A';
    while(ch <= 'Z')
    {
        strcpy(image->status, "最新");
        strcpy(image->lsttime, GetCurrentTime().c_str());
        strcpy(image->image, "this is image data ...");
        ch++;
        sleep(1);
    }
    

    gShareMemory.DetachShm();
    return 0;
}